//
//  YBLoveGodCell.m
//  yibeilive
//
//  Created by 南无本师释迦牟尼佛 on 2022/11/18.
//

#import "YBLoveGodCell.h"

@implementation YBLoveGodCell

// 初始化控件
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _titleLabel = [[UILabel alloc] init];
        _titleLabel.numberOfLines = 0;
        _titleLabel.font = kSystemFont(15);
        _titleLabel.textColor = kBlackColor;
        [self.container addSubview:_titleLabel];
    }
    return self;
}

// 根据 cellData 绘制 cell
- (void)fillWithData:(YBLoveGodCellData *)data {
    [super fillWithData:data];
    
    self.customData = data;
    self.titleLabel.text = data.text;
}

// 设置控件坐标
- (void)layoutSubviews {
    [super layoutSubviews];
    
    self.titleLabel.frame = (CGRect){.origin = self.customData.textOrigin, .size = self.customData.textSize};
}

@end
